<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
	body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
	</style>
  <script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=R1oWgdhr2jbEV2RYrVemCvef8GhWUBBa"></script>
	<title>地图展示</title>
</head>
<body>
	<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
	// 百度地图API功能
	var map = new BMapGL.Map("allmap");    // 创建Map实例
	map.centerAndZoom(new BMapGL.Point(116.404, 39.915), 11);  // 初始化地图,设置中心点坐标和地图级别
	//添加地图类型控件
	map.addControl(new BMapGL.MapTypeControl({
		mapTypes:[
            BMAP_NORMAL_MAP,
            BMAP_HYBRID_MAP
        ]}));	  
        var point = new BMapGL.Point(116.404, 39.915);
	map.centerAndZoom(point, 15);
  

  var marker = new BMapGL.Marker(new BMapGL.Point(116.404, 39.915)); // 创建点
	var polyline = new BMapGL.Polyline([
		new BMapGL.Point(116.399, 39.910),
		new BMapGL.Point(116.405, 39.920),
		new BMapGL.Point(116.425, 39.900)
  ], {strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
  
  //添加覆盖物
	function add_overlay(){
		map.addOverlay(marker);            //增加点
		map.addOverlay(polyline);          //增加折线
  }
  
  add_overlay();

</script>